﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading.Tasks;

namespace Wpf
{
     
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.DoubleBuffered = true;
        }


        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            this.Invalidate();
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            timer1.Enabled = true;
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            int zoom = trackBar1.Value;
            Graphics g = e.Graphics;
        
            g.FillPie(Brushes.Blue, 60, 40, 40 * zoom / 100, 40 * zoom / 100, 10, 400);
            g.FillPie(Brushes.Blue, 40, 75, 80 * zoom / 100, 80 * zoom / 100, 10, 400);

            Pen p = new Pen(Brushes.Brown);
            g.DrawEllipse(p, 260, 85, 50 * zoom / 100, 50 * zoom / 100);
            g.DrawEllipse(p, 250, 125, 70 * zoom / 100, 70 * zoom / 100);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (trackBar1.Value < 100)
            {
                trackBar1.Value++;
                Invalidate();
            }
        }
    }
}
